<style>
    .measure-input{
        background:transparent url("${ctxPath}/static/images/ruler.gif") repeat-x scroll 0 bottom
    }
    .mutiUpload{
        max-width: 510px;
        height:auto;
        font-size: 18px;
        margin-left: 90px;
        margin-top: -10px;
    }
    .mutiUpload div{
        line-height: 1.8;
    }
    .mutiUpload p{
        font-size: 20px;
    }
    .bjui-pageContent{
        margin: 0 auto;
    }
    .hidden-self{
        display: none;
    }
    .hidden-self.show{
        display: block;
    }
     #filePicker div:nth-child(2){width:100%!important;height:100%!important;}
</style>
@if(isWindow=="NO"){
<div class="bjui-pageHeader">
        <div class="bjui-searchBar">

            <a class="btn btn-default" data-icon="reply" href="${ctxPath}/system/cms/content/pageContent?categoryId=${category.categoryId!}"  data-toggle="ajaxload" data-target="#layout-content">返回栏目</a>&nbsp;
            <div class="pull-right">
                @if(has(content)){
                <!--<a class="btn btn-default" data-icon="desktop" href="${ctxPath}/system/cms/content/input?categoryId=${category.categoryId!}&contentId=${content.content_id!}&isWindow=YES" data-toggle="dialog" data-width="850" data-height="650" data-id="post-content-window-tab" data-mask="true">窗口模式</a>&nbsp;-->
                @}else{
                <!--<a class="btn btn-default" data-icon="desktop" href="${ctxPath}/system/cms/content/input?categoryId=${category.categoryId!}&isWindow=YES" data-toggle="dialog" data-width="900" data-height="600" data-id="post-content-window-tab" data-mask="true">窗口模式</a>&nbsp;-->
                @}
            </div>

        </div>
</div>
@}
<div class="bjui-pageContent">
    <form method="post" action="${ctxPath}/system/cms/content/save" id="j_model_form" data-toggle="validate" data-autorefresh="true" data-alertmsg="false">
        <input TYPE="hidden" name="contentId" value="${content.contentId!}">
        <input TYPE="hidden" name="userId" value="${session.SysUser.userId!}">
        <input TYPE="hidden" name="siteId" value="${session.SysUser.siteId!}">
        <input type="hidden" name="tableName" value="${model.tableName!}" >
        <input TYPE="hidden" id="status" name="status" >
        <input TYPE="hidden" id="scheduledRelease" name="scheduledRelease" >

        <#view_show viewId = "1" categoryId="${category.categoryId}"  var="item">
            @if(isNotEmpty(item) && item.isShow){
            <div class="form-group">
                <label for="j_title" class="control-label x100">标题：</label>
                <input type="text" name="title" id="j_title" class="input-nm measure-input" value="${content.title!,xss}"   placeholder="请填写标题" size="50" data-rule="required;length(1~128)" >
            </div>
            <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
            @}
        </#view_show>
        <#view_show viewId = "2" categoryId="${category.categoryId}"  var="item">
            @if(isNotEmpty(item) && item.isShow){
            <div class="form-group">
                <label for="j_keyword" class="control-label x100">关键字：</label>
                <input type="text" name="keywords" id="j_keyword"  class="input-nm"  value="${content.keywords!,xss}"   placeholder="关键字请用逗号，隔开" size="50" data-rule="required;length(1~128)" >
            </div>
            <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
            @}
        </#view_show>

        <#view_show viewId = "3" categoryId="${category.categoryId}"  var="item">
            @if(isNotEmpty(item) && item.isShow){
            <div class="form-group">
                <label for="j_des" class="control-label x100">描述：</label>
                 <textarea id="j_des" name="description" data-rule="required;length(10~300)" style="height: 150px"  placeholder="请填写文章描述"  cols="50">${content.description!,xss}</textarea>
            </div>
            <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
            @}
        </#view_show>

        <#view_show viewId = "4" categoryId="${category.categoryId}"  var="item">
            @if(isNotEmpty(item) && item.isShow){
            <div class="form-group">
                <label for="categoryId" class="control-label x100">栏目：</label>
                <select id="categoryId"  data-toggle="selectpicker"  class="input-nm"  readonly="readonly"   name="categoryId">
                   ${ContentSelectCategoryFunctionAutomatic(session.SysUser.siteId!0,category.categoryId!0)}
                </select>
            </div>
            <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
            @}
        </#view_show>





        <div class="form-group">

            <#view_show viewId = "5" categoryId="${category.categoryId}"  var="item">
            @if(isNotEmpty(item) && item.isShow){
            <div>
                <label class="control-label x100">封面单图：</label>
                <div style="display: inline-block; vertical-align: middle;">
                    <div id="j_content_thumb" data-toggle="upload" data-uploader="${ctxPath}/upload"
                         data-file-size-limit="1024000000"
                         data-file-type-exts="*.jpg;*.png;*.gif;*.mpg"
                         data-multi="false"
                         data-on-upload-success="thumb_upload_success"
                         data-icon="cloud-upload"></div>
                    <input type="hidden" name="thumb" value="${content.thumb!}" id="j_custom_pic">
                    <span id="j_custom_span_pic">
                    @if(isNotEmpty(content.thumb)){
                    <IMG WIDTH="200" HEIGHT="120"  style="margin: 10px 0 0 0" src="${content.thumb!}">
                    @}
                </span>
                    <br>
                </div>
                <span style="color: darkgreen">（大小：1M以内，格式：jpg;png;gif;mpg）</span>
            </div>
            <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
            @}
            </#view_show>

            <#view_show viewId = "6" categoryId="${category.categoryId}"  var="item">
            @if(isNotEmpty(item) && item.isShow){
            <div>
                <label class="control-label x100">封面多图：&nbsp;&nbsp;&nbsp;</label>
                <input type="file" class="form-control" data-name="imageUrl" data-toggle="webuploader" data-options="
                        {
                            pick: {label: '点击选择多张图片'},
                            server: '${ctxPath}/upload',
                            fileNumLimit: 3,
                            formData: {dir:'imageUrl'},
                            required: true,
                            uploaded: '${content.imageUrl!}',
                            basePath: '',
                            accept: {
                                title: '图片',
                                extensions: 'jpg,JPG,jpeg,JPEG,png,gif',
                                mimeTypes: '.jpg,.JPG,.jpeg,.png,gif'
                            }
                        }"
                >
                <input TYPE="hidden" class="imageUrl" name="imageUrl" value="${content.imageUrl!}" >
                <span style="color: darkgreen; padding-left: 5%">（单图大小：1M以内，上传三张，格式：jpg;png;gif;mpg）</span>
            </div>
            <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
            @}
            </#view_show>
        </div>

        <#view_show viewId = "7" categoryId="${category.categoryId}"  var="item">
        @if(isNotEmpty(item) && item.isShow){
        <div>
            <div class="form-group">
                <label class="control-label x100">封面视频：</label>
                <div style="display: inline-block; vertical-align: middle;">
                    <div id="j_content_video_url" data-toggle="upload" data-uploader="${ctxPath}/upload"
                         data-file-size-limit="1024000000000"
                         data-file-type-exts="*.mov;*.rmvb;*.rm;*.mp4;*.webm;*.ogg"
                         data-multi="false"
                         data-on-upload-success="videoUrl_upload_success"
                         data-icon="cloud-upload"></div>
                    <input type="hidden" name="videoUrl" value="${content.videoUrl!}" id="j_custom_videoUrl">
                    <span id="j_custom_span_videoUrl">
                    @if(isNotEmpty(content.videoUrl)){
                        <input type="text" class="input-nm form-control" style="margin: 5px 0px 0px; width: 500px;" size="50" placeholder="视频" value="${content.videoUrl!}" id="video_url_file">
                    @}
                </span>
                    <span style="color: darkgreen">（视频大小：50M以内，格式：mov;mp4;webm;ogg）</span>
                </div>
            </div>
        </div>
        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
        @}
        </#view_show>

        <#view_show viewId = "15" categoryId="${category.categoryId}"  var="item">
        @if(isNotEmpty(item) && item.isShow){
        <div  class="form-group">
            <label  class="control-label x100">首页展示类型：</label>
            @if(!has(content)){
            <input type="radio" name="showType" data-id="one_pic" value="0" checked data-label="单图" > 单图 </input>&nbsp;&nbsp;&nbsp;
            <input type="radio" name="showType" data-id="one_video" value="2" data-label="视频"> 视频 </input>&nbsp;&nbsp;&nbsp;
            @}else{
            <input type="radio" name="showType" data-id="one_pic" value="0" data-label="单图" ${(isNotEmpty(content.showType)&&strutil.contain(content.showType,'0'))?'checked':''}> 单图 </input>&nbsp;&nbsp;&nbsp;
            <input type="radio" name="showType" data-id="one_video" value="2" data-label="视频" ${(isNotEmpty(content.showType)&&strutil.contain(content.showType,'2'))?'checked':''}> 视频 </input>&nbsp;&nbsp;&nbsp;
            @}
        </div>
        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
        @}
        </#view_show>

        <#view_show viewId = "8" categoryId="${category.categoryId}"  var="item">
        @if(isNotEmpty(item) && item.isShow){
        <div class="form-group">
            <label for="j_url" class="control-label x100">外部链接：</label>
            <input type="text" name="url" id="j_url"  value="${content.url!,xss}"  class="input-nm"   placeholder="如果填写为外部链接，则文章链接以外部链接为准" size="50" data-rule="url;" >
        </div>
        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
        @}
        </#view_show>

        <#view_show viewId = "9" categoryId="${category.categoryId}"  var="item">
        @if(isNotEmpty(item) && item.isShow){
        <div  class="form-group">
            <label  class="control-label x100">推荐：</label>
            <input type="checkbox"  id="recommend" name="recommend"  data-toggle="icheck" data-label="推荐" ${(isNotEmpty(content.recommend)&&content.recommend)?'checked':''}>
            <!--<input type="checkbox"  id="top" name="top" data-toggle="icheck" data-label="顶置" ${(isNotEmpty(content.top)&&content.top)?'checked':''}>-->
        </div>
        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
        @}
        </#view_show>

        <#view_show viewId = "10" categoryId="${category.categoryId}"  var="item">
        @if(isNotEmpty(item) && item.isShow){
        <div class="form-group">
            <label for="j_viewnum" class="control-label x100">浏览次数：</label>
            <input type="text" name="viewNum" id="j_viewnum"  class="input-nm"   placeholder="浏览量" value="${content.viewNum!0}"  size="20" data-rule="required;integer(+0)" >
        </div>
        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
        @}
        </#view_show>

        <#view_show viewId = "11" categoryId="${category.categoryId}"  var="item">
        @if(isNotEmpty(item) && item.isShow){
        <div class="form-group">
            <label for="j_author" class="control-label x100">作者：</label>
            <input type="text" name="author" id="j_author"  class="input-nm"   placeholder="文章作者" value="${isEmpty(content.author)?session.SysUser.username:content.author!,xss}"  size="20" data-rule="required;" >
        </div>
        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
        @}
        </#view_show>

        <#view_show viewId = "12" categoryId="${category.categoryId}"  var="item">
        @if(isNotEmpty(item) && item.isShow){
        <div class="form-group">
            <label  class="control-label x100">标签：</label>
            <input type="text" name="tags" data-toggle="tags"  VALUE="${content.tags!}"  data-url="${ctxPath}/system/cms/tag/json" data-width="500"  placeholder="输入关键字，回车提交">
        </div>
        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
        @}
        </#view_show>

        <#view_show viewId = "13" categoryId="${category.categoryId}"  var="item">
        @if(isNotEmpty(item) && item.isShow){
        <div class="form-group">
            <label class="control-label x100">发布时间：</label>
            <input type="radio" name="inputdate" checked data-label="立即发布" value=""> 立即发布 </input>&nbsp;&nbsp;&nbsp;
            <!--<input type="radio" id="inputdate" onclick="time_show2()" name="inputdate" value="" data-label="定时发布" > 定时发布 </input>-->
            <!--<span id="timeShow" class="hide"><input type="datetime-local" id="time_show" name="publishTime" value="" onblur="compareDate();"><span style="color: darkgreen">&nbsp;&nbsp;Tips: 时间精确到分钟，否则无效</span></span>-->
        </div>
        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
        @}
        </#view_show>

        <#view_show viewId = "14" categoryId="${category.categoryId}"  var="item">
        @if(isNotEmpty(item) && item.isShow){
            @if(isNotEmpty(session.SysUser.siteId) && session.SysUser.siteId == 1){
                <div class="form-group">
                    <label class="control-label x100">推送配置：</label>
                    @if(!has(content)){
                    <input type="checkbox" name="siteType" value="1" checked data-label="直营店" > 直营店 </input>&nbsp;&nbsp;&nbsp;
                    <input type="checkbox" name="siteType" value="2" data-label="优质代理" > 优质代理 </input>&nbsp;&nbsp;&nbsp;
                    <input type="checkbox" name="siteType" value="3" data-label="普通代理" > 普通代理 </input>
                    @}else{
                    <input type="checkbox" name="siteType" value="1" data-label="直营店" ${(isNotEmpty(content.siteType)&&strutil.contain(content.siteType,'1'))?'checked':''}> 直营店 </input>&nbsp;&nbsp;&nbsp;
                    <input type="checkbox" name="siteType" value="2" data-label="优质代理" ${(isNotEmpty(content.siteType)&&strutil.contain(content.siteType,'2'))?'checked':''}> 优质代理 </input>&nbsp;&nbsp;&nbsp;
                    <input type="checkbox" name="siteType" value="3" data-label="普通代理" ${(isNotEmpty(content.siteType)&&strutil.contain(content.siteType,'3'))?'checked':''}> 普通代理 </input>
                    @}
                </div>
            @}else{
                <input type="hidden" name="siteType" value="${siteType!}">
            @}
        @}
        </#view_show>

        <#view_show viewId = "16" categoryId="${category.categoryId}"  var="item">
            @if(isNotEmpty(item) && item.isShow){
            <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
            <div class="form-group">
                <label for="sortNum" class="control-label x100">排序号：</label>
                <input type="text" name="sortNum" id="sortNum" class="input-nm" placeholder="排序号" value="${isEmpty(content.sortNum)?0:content.sortNum!,xss}" size="11" data-rule="required;" >
            </div>
            @}
        </#view_show>

        @for(filed in modelFiled){
        <hr style="margin-top: 3px!important;padding-top: 3px;margin-bottom: 3px!important;">
        <div class="form-group">
            @if(filed.filedClass=="input"){
            <!--TODO 有待做详细的表单验证-->
            <!--普通表单输入-->
            @var t="";
            @if(filed.notNull){
            @t ="data-rule=\"required;";
            @if(filed.filedType=='int'){
            @t=t+"'integer;'";
            @if(filed.filedLength>1){
            @t=t+"length(1~"+filed.filedLength+");";
            @}else{
            @t=t+"length("+filed.filedLength+");";
            @}
            @}
            @t=t+"\"";
            @}
            <label for="${filed.filedName!}" class="control-label x100">${filed.alias}：</label>
            @if(filed.filedId == 311){
                <!-- 判断是否是热装楼盘要输入的地址 filedId == 311为地址 -->
                <input type='text' name='${filed.filedName!}' id='inputAddress' required class='input-nm' placeholder='${filed.alias!}' value='${(!has(content)?filed.filedValue!:content[filed.filedName]!),xss}'  size='50' ${t!}>
                <button type="button" onclick="getLatAndLng();" style="color: #00c0ef" value="查询经纬度">查询经纬度</button>
                <span style="color: red; font-size: smaller">(建议格式为：北京市海淀区上地十街10号)</span>
            @}else if(filed.filedId == 315 || filed.filedId == 316){
                <!-- 判断是否是热装楼盘的经纬度 filedId == 315或316为经纬度 -->
                <input type='text' name='${filed.filedName!}' id='${filed.filedName!}'  class='input-nm' placeholder='${filed.alias!}' value='${(!has(content)?filed.filedValue!:content[filed.filedName]!),xss}'  size='50' ${t!}>
            @}else if(filed.filedId == 313){
                <!-- 判断是否是热装楼盘的经纬度 filedId == 313为行政区 -->
                @if(site.siteId == 1){
                    <input type="hidden" id="initProvince" value="${pojo.provinceCode!}">
                    <input type="hidden" id="initCity" value="${pojo.cityCode!}">

                    <label>站点省份:</label>
                    <select name="provinceCode" id="l_province" data-toggle="selectpicker">
                        <option value="0" name="">所有省份</option>
                    </select>
                    <label>站点城市:</label>
                    <select name="cityCode" id="l_city" data-toggle="selectpicker">
                        <option value="0" name="">所有城市</option>
                    </select>
                    <label>城市区县:</label>
                    @if(isNotEmpty(content) && content.district != null){
                        <select name="districtCode" data-toggle="selectpicker">
                            <option value="0">${content.district!}</option>
                        </select>
                    @}else{
                        <select name="districtCode" id="l_district" data-toggle="selectpicker">
                            <option value="0">所有区县</option>
                        </select>
                    @}
                    <input type="hidden" name="district" value="${(!has(content)?filed.filedValue!:content[filed.filedName]!),xss}" id="districtName">
                @}else{
                    <select name="${filed.filedName!}" data-toggle="selectpicker" id="${filed.filedName!}">
                        @for(district in districtList){
                        @var selected = "";
                        @if(has(content)){
                        @if(district.cityName==content[filed.filedName]){
                        @selected="selected";
                        @}
                        @}
                            <option value="${district.cityName!}" ${selected!}>${district.cityName!}</option>
                        @}
                    </select>
                @}
            @}else if(filed.filedId == 314){
                <!-- 判断是否是热装楼盘的经纬度 filedId == 314为行政区编码 -->
                @if(site.siteId == 1){
                    <input type='text' name='${filed.filedName!}' readonly id="selectedCity" value="${(!has(content)?filed.filedValue!:content[filed.filedName]!),xss}">
                @}else{
                    <input type='text' name='${filed.filedName!}' readonly id="defaultCityCode" value="${(!has(content)?filed.filedValue!:content[filed.filedName]!),xss}">
                    <input type='hidden' name='${filed.filedName!}' id="defaultCode" value="${site.cityCode}">
                @}
            @}else{
                <input type='text' name='${filed.filedName!}' id='${filed.filedName!}'  class='input-nm' placeholder='${filed.alias!}' value='${(!has(content)?filed.filedValue!:content[filed.filedName]!),xss}'  size='50' ${t!}>
            @}
            @}

            @if(filed.filedClass=="image"){
            <!--判断是否为图片上传字段-->
            <!--TODO 有待做自定义文件类型-->
            <label for="${filed.filedName!}" class="control-label x100">${filed.alias}：</label>
            <input type="file" class="form-control" data-name="${filed.filedName!}" data-toggle="webuploader" data-options="
                        {
                            pick: {label: '点击选择图片'},
                            server: '${ctxPath}/upload',
                            fileNumLimit: 4,
                            formData: {dir:'${filed.filedName!}'},
                            required: true,
                            uploaded: '${content[filed.filedName]!}',
                            basePath: '',
                            accept: {
                                title: '图片',
                                extensions: 'jpg,JPG,jpeg,JPEG,png,gif',
                                mimeTypes: '.jpg,.JPG,.jpeg,.png,gif'
                            }
                        }"
            >
            <input TYPE="hidden" class="${filed.filedName!}" name="${filed.filedName!}"  value="${!has(content)?'':content[filed.filedName]}" >
            <span  style="color: darkgreen;margin-left: 90px">（大小：1M以内，格式：jpg;png;gif;jpeg）</span>
            @}

            @if(filed.filedClass=="file"){
            <!--判断是否为文件上传字段-->
            <script type="text/javascript">
                function ${filed.filedName!}_upload_success(file, data) {
                    var json = $.parseJSON(data)
                    $(this).bjuiajax('ajaxDone', json)
                    if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
                        $('#${filed.filedName!}').val(json.filename).trigger('validate');
                        $('#${filed.filedName!}_file').val(json.filename);
                    }
                }
            </script>
            <label for="${filed.filedName!}" class="control-label x100">${filed.alias}：</label>
            <div style="display: inline-block; vertical-align: middle;">
                <!--遍历获取运行上传的文件类型-->
                @var strs = strutil.split(filed.filedValue,"#");
                @var str="";
                @if(isNotEmpty(strs)){
                   @for(s in strs){
                     @str=str+"*."+s+";";
                   @}
                @}
                <div id="${filed.filedName!}" data-toggle="upload" data-uploader="${ctxPath}/upload"
                     data-file-size-limit="1024000000"
                     data-file-type-exts="${isNotEmpty(str)?strutil.subStringTo(str,0,strutil.length(str)-1):'*.jpg;*.png;*.gif;*.mpg;*.docx;*.doc;*.xls;*.xlsx'}"
                     data-multi="false"
                     data-on-upload-success="${filed.filedName!}_upload_success"
                     data-icon="cloud-upload"></div>
                <span>
                   <input type="text"  class="input-nm" style="margin: 5px 0 0 0"    size="50" name="${filed.filedName!}" placeholder="${filed.alias!}" value="${(!has(content)?'':content[filed.filedName]!),xss='escape'}" id="${filed.filedName!}_file">
                </span>
            </div>
            @}

            @if(filed.filedClass=="editor"){
            <!--判断是否为文本编辑器-->
            <label for="${filed.filedName!}" style="margin-bottom: 5px" class="control-label x100">${filed.alias}：</label>
            <textarea  data-toggle="CKEditor"  data-upload="${ctxPath}/upload/CKEditorUpload"   style="height:650px;max-height:750px;margin:10px 0 0 0" name="${filed.filedName!}"  ${filed.notNull?'data-rule=\"required;\"':''}>${(has(content)?content[filed.filedName]:filed.filedValue),xss="escape"}</textarea>
            @}

            @if(filed.filedClass=="textarea"){
            <label for="${filed.filedName!}" class="control-label x100">${filed.alias}：</label>
            <!--判断是否为文本编辑器-->
            <textarea id="${filed.filedName!}"  name="${filed.filedName!}"  value=""  PLACEHOLDER="${filed.filedValue!}"  cols="50" ${filed.notNull?'data-rule=\"required;\"':''}>${(!has(content)?filed.filedValue:content[filed.filedName]),xss="escape"}</textarea>
            @}

            @if(filed.filedClass=="dateInput"){
            <label for="${filed.filedName!}" class="control-label x100">${filed.alias}：</label>
            <!--判断是否为日期输入框-->
            <input type="text"  name="${filed.filedName!}" data-toggle="datepicker" value="${(!has(content)?filed.filedValue!:content[filed.filedName]),xss}" data-pattern="yyyy-MM-dd HH:mm:ss">
            @}

            @if(filed.filedClass=="radio"){
            <label class="control-label x100">${filed.alias}：</label>
            <!--判断是否为单选按钮-->
              @if(isNotEmpty(filed.filedValue)){
                @var radios = strutil.split(filed.filedValue,"#");
            产品清单：
                @for(radio in radios){
                 @var checked ="";
                 @if(has(content)){
                   @if(radio==content[filed.filedName]){
                     @checked="checked";
                   @}
                  @}
                 <input  type="radio" name="${filed.filedName!}"  id="${filed.filedName!}_${radio}" ${checked!} data-toggle="icheck" data-label="[${radio}]" value="${radio}" ${filed.notNull?'data-rule=\"required;\"':''}></input>
                @}
               @}
            @}

            @if(filed.filedClass=="checkbox"){
            <label for="${filed.filedName!}" class="control-label x100">${filed.alias}：</label>
              <!--判断是为多选按钮-->
                @if(filed.filedId == 248 || filed.filedId == 253){
                    <!-- 判断是否是智慧化系统 -->
                    <#content_select siteType="${siteType!}" contentId="${content.contentId!}" modelId ="44" var = "content">
                        <input  type="checkbox"  name="${filed.filedName!}" ${content.checked!}	data-toggle="icheck" data-label="${content.title!}" value="${content.content_id!}" data-rule=\"required;\"}></input>
                    </#content_select>
                @}else if(filed.filedId == 249 || filed.filedId == 254){
                    <!-- 判断是否是产品清单 -->
                    <#content_select siteType="${siteType!}" contentId="${content.contentId!}" modelId ="42" var = "content">
                        <input  type="checkbox"  name="${filed.filedName!}" ${content.checked!}	data-toggle="icheck" data-label="${content.title!}" value="${content.content_id!}" data-rule=\"required;\"}></input>
                    </#content_select>
                @}else if(isNotEmpty(filed.filedValue)){
                   @var checkboxs = strutil.split(filed.filedValue,"#");
                    @for(checkbox in checkboxs){
                      @var checked ="";
                        @if(has(content)){
                            @if(checkbox==content[filed.filedName]){
                              @checked="checked";
                            @}
                        @}
                     <input  type="checkbox"  name="${filed.filedName!}" id="${filed.filedName!}"  ${checked!}	data-toggle="icheck" data-label="${checkbox}" value="${checkbox}" ${filed.notNull?'data-rule=\"required;\"':''}></input>
                    @}
                @}
            @}

            @if(filed.filedClass=="select"){
            <label for="${filed.filedName!}" class="control-label x100">${filed.alias}：</label>
              <!--判断是为单选菜单-->
              @if(isNotEmpty(filed.filedValue)){
                @var selects = strutil.split(filed.filedValue,"#");
                 <select name="${filed.filedName!}" data-toggle="selectpicker" ${filed.notNull?'data-rule=\"required\"':''}>
                 <option value=""  selected>所有</option>
                 @for(s in selects){
                   @var selected ="";
                   @if(has(content)){
                    @if(s==content[filed.filedName]){
                     @selected="selected";
                    @}
                   @}
                   <option value="${s}" ${selected!}>${s}</option>
                 @}
                 </select>
              @}
            @}
        </div>
        @}
    </form>
    </div>
<div class="bjui-pageFooter">
    <ul>
        <!--发布状态： 1: 发布, 0: 草稿,  -1: 已删除，2：审核中，3：发布失败-->
        <li><button onclick="content_save()" type="submit" class="btn btn-blue" data-icon="pencil">暂存草稿</button></li>
        <li><button onclick="content_audit()" type="submit" class="btn btn-green" data-icon="send" data-title="提交审核">保存发布</button></li>
    </ul>
</div>
<script src="https://api.map.baidu.com/api?v=3.0&ak=gRy9KfeMXpIfKcCZCzCYsj0slHwfopIG" type="text/javascript"></script>
<script type="text/javascript">

    function getLatAndLng(){
        var inputAddress = $("#inputAddress").val();
        var ak = "gRy9KfeMXpIfKcCZCzCYsj0slHwfopIG";
        var url = "https://api.map.baidu.com/geocoding/v3/?address=" + inputAddress + "&output=json&ak=" + ak + "&callback=showLocation"

        $.ajax({
            type: "GET",
            url:url,
            dataType: "jsonp",
            success: function (data) {
                if (data.status === 0) {
                    $("#longitude").val(data.result.location.lng);
                    $("#latitude").val(data.result.location.lat);
                }
            },
            error: function () {
                alert("返回的数据有误");
            }
        });
    }

    $(function(){
        $("input[type='radio'][name='showType']").each(function(){
            if($(this).is(':checked') ){
                var type = $(this).data("id");
                $(".hidden-self").removeClass("show");
                $("#"+type).addClass("show");
            }
        })
    })
    function thumb_upload_success(file, data) {
        var json = $.parseJSON(data)
        $(this).bjuiajax('ajaxDone', json)
        if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
            $('#j_content_thumb').val(json.filename).trigger('validate')
            $('#j_custom_pic').val(json.filename)
            $('#j_custom_span_pic').html('<img src="'+ json.filename +'"  style="margin: 10px 0 0 0" WIDTH="200" HEIGHT="120"/>')
        }
    }

    function videoUrl_upload_success(file, data) {
        var json = $.parseJSON(data)
        $(this).bjuiajax('ajaxDone', json)
        if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
            $('#j_content_videoUrl').val(json.filename).trigger('validate')
            $('#j_custom_videoUrl').val(json.filename)
            $('#j_custom_span_videoUrl').html('<input readonly="readonly" value="'+ json.filename +'" class="input-nm form-control" style="margin: 10px 0 0 0" WIDTH="200" HEIGHT="120"/>')
        }
    }
    // 发布状态： 1: 发布, 0: 草稿,  -1: 已删除，2：审核中，3：审核通过
    /*function content_save_post(){
        $("#status").val("1");
    }*/
    function content_save(){
        $("#status").val("0");
    }
    function content_audit(){
        $("#status").val("2");
    }

    $("#defaultCityCode").val($("#defaultCode").val());

    var initProvince = $("#initProvince").val();
    var initCity = $("#initCity").val();

    getProviceList(true, "#l_province", "#l_city", initProvince, initCity);
    $("#l_province").change(function () {
        var provinceCode = this.value;
        getCityListByProvice(provinceCode, true, "#l_city", null);
    });
    $("#l_city").change(function () {
        var cityCode = this.value;
        getDistrictListByCity(cityCode, true, "#l_district", null);
        $("#selectedCity").val($("#l_city").val());
    });
    $("#l_district").change(function () {
        $("#districtName").val(document.querySelector('#l_district option:checked').text);
    });
    /**
     * 获取省份列表
     * hasAll 是否含有全部
     * provinceElem 省份元素
     * cityElem 城市元素
     * initProvince 省份初始值
     * initCity 城市初始值
     */
    function getProviceList(hasAll, provinceElem, cityElem, initProvince, initCity){
        var url =  "${ctxPath}/city/getProviceList";
        $.post(url,null,function(data){
            var html = "";
            if(hasAll){
                html += "<option value='0'>所有省份</option>";
            }
            var list = data.result;
            for(var i=0; i < list.length; i++){
                if(initProvince != null && list[i].cityCode == initProvince){
                    html += "<option value='"+list[i].cityCode+"' selected>"+list[i].cityName+"</option>";
                    getCityListByProvice(list[i].cityCode, hasAll, cityElem, initCity);
                }else{
                    html += "<option value='"+list[i].cityCode+"'>"+list[i].cityName+"</option>";
                }
                if(!hasAll && initCity == null && i == 0){
                    getCityListByProvice(list[i].cityCode, hasAll, cityElem, initCity);
                }
            }
            $(provinceElem).html(html);
            $(provinceElem).selectpicker("refresh");
        },"json");
    }

    /**
     * 获取城市列表
     * hasAll 是否含有全部
     * provinceCode 省份code
     * cityElem 城市元素
     * initCity 城市初始值
     */
    function getCityListByProvice(provinceCode, hasAll, cityElem, initCity){
        var url = "${ctxPath}/city/getCityListByProvice";
        $.post(url,{provinceCode:provinceCode},function(data){
            var html = "";
            if(hasAll){
                html += "<option value='0'>所有城市</option>";
            }
            var list = data.result;
            for(var i=0; i < list.length; i++){
                if(initCity != null && list[i].cityCode == initCity){
                    html += "<option value='"+list[i].cityCode+"' selected>"+list[i].cityName+"</option>";
                }else{
                    html += "<option value='"+list[i].cityCode+"'>"+list[i].cityName+"</option>";
                }
            }
            $(cityElem).html(html);
            $(cityElem).selectpicker("refresh");
        },"json");
    }

    /**
     * 获取区县列表
     * hasAll 是否含有全部
     * cityCode 城市code
     * cityElem 城市元素
     * initCity 城市初始值
     */
    function getDistrictListByCity(cityCode, hasAll, districtElem, initCity){
        var url = "${ctxPath}/city/getDistrictListByCity";
        $.post(url,{cityCode:cityCode},function(data){
            var html = "";
            if(hasAll){
                html += "<option value='0'>所有区县</option>";
            }
            var list = data.result;
            for(var i=0; i < list.length; i++){
                if(initCity != null && list[i].cityCode == initCity){
                    html += "<option value='"+list[i].cityCode+"' selected>"+list[i].cityName+"</option>";
                }else{
                    html += "<option value='"+list[i].cityCode+"'>"+list[i].cityName+"</option>";
                }
            }
            $(districtElem).html(html);
            $(districtElem).selectpicker("refresh");
        },"json");
    }
</script>